'use strict';
goog.provide('Blockly.Blocks.tts');
goog.require('Blockly.Blocks');

Blockly.Msg['ACTUATOR_HUE'] = 100;
var serial_down = [ 
    ["Serial1", "Serial1"],
    ["Serial2", "Serial2"]
];
var tts_mvst = [
    [Blockly.Msg.tts_m,'m'],
    [Blockly.Msg.tts_v,'v'],
    [Blockly.Msg.tts_s,'s'],
    [Blockly.Msg.tts_t,'t']
];
var tts_number = [
    ['0','0'],
    ['1','1'],
    ['2','2'],
    ['3','3'],
    ['4','4'],
    ['5','5'],
    ['6','6'],
    ['7','7'],
    ['8','8'],
    ['9','9']
];
var tts_speekRingtones = [
    ["ring_1","ring_1"],
    ["ring_2","ring_2"],
    ["ring_3","ring_3"],
    ["ring_4","ring_4"],
    ["ring_5","ring_5"],
    ["message_1","message_1"],
    ["message_2","message_2"],
    ["message_3","message_3"],
    ["message_4","message_4"],
    ["message_5","message_5"],
    ["alert_1","alert_1"],
    ["alert_2","alert_2"],
    ["alert_3","alert_3"],
    ["alert_4","alert_4"],
    ["alert_5","alert_5"],
]
Blockly.Blocks.tts_init = {
    init: function() {
        this.setColour(Blockly.Msg['ACTUATOR_HUE']);
        this.appendDummyInput("")
           .appendField(Blockly.Msg.tts_init)
           .appendField(new Blockly.FieldDropdown(serial_down), "SERIAL_PORT");
        this.setInputsInline(true);
        this.setPreviousStatement(true);
        this.setNextStatement(true);
    }
};

Blockly.Blocks.tts_setTTSParameters = {
    init: function() {
        this.setColour(Blockly.Msg['ACTUATOR_HUE']);
        this.appendDummyInput("")
           .appendField(Blockly.Msg.tts_setTTSParameters)
           .appendField(new Blockly.FieldDropdown(tts_mvst), "SET_DOWN")
           .appendField(" ")
           .appendField(new Blockly.FieldDropdown(tts_number), "TTS_NUMBER");
        this.setInputsInline(true);
        this.setPreviousStatement(true);
        this.setNextStatement(true);
    }
};
Blockly.Blocks.tts_speek = {
    init: function() {
        this.setColour(Blockly.Msg['ACTUATOR_HUE']);
        this.appendDummyInput("")
           .appendField(Blockly.Msg.tts_tetx);
        this.appendValueInput('TTS_TXT')
           .setCheck([String])
        this.setInputsInline(true);
        this.setPreviousStatement(true);
        this.setNextStatement(true);
    }
};
Blockly.Blocks.tts_speekRingtones = {
    init: function() {
        this.setColour(Blockly.Msg['ACTUATOR_HUE']);
        this.appendDummyInput("")
           .appendField(Blockly.Msg.tts_speekRingtones)
           .appendField(new Blockly.FieldDropdown(tts_speekRingtones), "tts_Ringtones");
        this.setInputsInline(true);
        this.setPreviousStatement(true);
        this.setNextStatement(true);
    }
};